package com.learn.project2.controller.wx.topic;


import com.learn.project2.model.vo.wx.topic.TopicDetailVO2;

import com.learn.project2.model.vo.wx.topic.TopicListVO2;
import com.learn.project2.model.vo.wx.topic.TopicRelatedVO2;
import com.learn.project2.service.wx.topic.TopicService2;
import com.learn.project2.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 微信小程序 /wx/topic的控制方法
 * @author 曹源
 * @date  2022/1/10 17:32
 * @version 1.0
 */
@RestController
@RequestMapping("wx/topic")
public class TopicController2 {

    @Autowired
    TopicService2 topicService2;

    Result result;
    /**
     * @description: 微信小程序 /wx/topic/list的控制方法
     * @param:
     * @return:
     * @author 曹源
     * @date: 2022-01-10 18:32
     */
    @RequestMapping("list")
    public Result list(Integer page ,Integer limit ) {
        TopicListVO2 topicListVO2 = topicService2.selectList(page,limit);
        return result.ok(topicListVO2);
    }
    /** 
     * @description: 微信小程序 /wx/topic/detail的控制方法 
     * @param:  
     * @return:  
     * @author 曹源
     * @date: 2022-01-10 19:55
     */ 
    @RequestMapping("detail")
    public Result detail(Integer id) {
       TopicDetailVO2 topicDetailVO2 = topicService2.selectDetail(id);
        return result.ok(topicDetailVO2);
    }

/**
 * @description: 微信小程序 /wx/topic/related的控制方法
 * @param:
 * @return:
 * @author 曹源
 * @date: 2022-01-10 20:19
 */
    @RequestMapping("related")
    public Result related(Integer id) {
        TopicRelatedVO2 topicRelatedVO2 =topicService2.selectRelated(id);
        return result.ok(topicRelatedVO2);
    }


}
